package com.biyeshengjiuye.controller;


import com.biyeshengjiuye.utils.SystemConstant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
public class JumpController {

    /**
     * 退出登录
     */
    @RequestMapping("/logout")
    public String logout(HttpSession session, String id) {
        if(id.equals("enterprise")){
            session.removeAttribute(SystemConstant.ENTERPRISELOGIN);
        }else{
            session.removeAttribute(SystemConstant.USERLOGIN);
        }
        return "redirect:/login.html";
    }


    /**
     * 去到登录页面
     * @return
     */
    @RequestMapping("/login.html")
    public String login(){
        return "/login";
    }

    /**
     * 去到首页页面
     * @return
     */
    @RequestMapping("/home.html")
    public String home(){
        return "/home";
    }

    /**
     *  去到企业主界面
     */
    @RequestMapping("enterprise/enterpriseHome.html")
    public String enterpriseHome(){
        return "enterprise/home";
    }


    /**
     * 去到招聘管理页面
     */
    @RequestMapping("enterprise/toEmploymentManager")
    public String toEmploymentManager() {
        return "enterprise/empl/emplManager";
    }


    /**
     * 去到job界面
     */
    @RequestMapping("/search.html")
    public String toSearch(){
        return "/search";
    }

    /**
     * 去到info界面
     */
    @RequestMapping("/info.html")
    public String toInfo(){
        return "/info";
    }
}
